#include "databasesutils.h"

QSqlDatabase DataBasesUtils::getInstance() {
  if (QSqlDatabase::contains("qt_sql_default_connection")) {
    dataBase = QSqlDatabase::database("qt_sql_default_connection");
    dataBase.setDatabaseName("SchoolDataBase.db");
  } else {
    dataBase = QSqlDatabase::addDatabase("QSQLITE");
    dataBase.setDatabaseName("SchoolDataBase.db");
  }
  return dataBase;
}
QSqlDatabase DataBasesUtils::dataBase;
DataBasesUtils::DataBasesUtils() {}
